package service.impl;

import dao.User_ManagementDao;
import entity.User_Management;
import service.User_ManagementService;

import javax.naming.NamingException;
import java.sql.SQLException;
import java.util.List;

public class User_ManagementServiceimpl implements User_ManagementService {
    User_ManagementDao dao=new dao.impl.User_MangementDaoimpl();
    @Override
    public List<User_Management> management(String username, int pageSize,int pageNum) throws SQLException, NamingException, ClassNotFoundException {
        return dao.management(username,pageSize,pageNum);
    }

    @Override
    public int INSERT(String username, String password, String role, String phone, String sex) throws SQLException, ClassNotFoundException {
        return dao.INSERT(username,password,role,phone,sex);
    }


    @Override
    public int UPDATE(int user_id,String username, String password, String role, String phone, String created_at, String sex) throws SQLException, ClassNotFoundException {
        return dao.UPDATE(user_id,username, password, role, phone, created_at, sex);
    }

    @Override
    public int delete(int user_id) throws SQLException, NamingException, ClassNotFoundException {
        return dao.delete(user_id);
    }

    @Override
    public int getTotalCount(String username) throws SQLException, NamingException, ClassNotFoundException {
        return dao.getTotalCount(username);
    }


}
